﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace ShevaEngine.Core.Foundation.Emitters
{
    /// <summary>
    /// Point emitter.
    /// </summary>
    public class PointEmitter : IEmitter
    {
        /// <summary>Random.</summary>
        public Random Random;
        /// <summary>Radius.</summary>
        private Single _Radius;
        /// <summary>Radius multiplier.</summary>
        private Single RadiusMultiplier;
        /// <summary>Radius.</summary>
        public Single Radius
        {
            get { return this._Radius; }
            set
            {
                this._Radius = value;
                this.RadiusMultiplier = this._Radius * 2;
            }
        }
        

        /// <summary>
        /// Constructor.
        /// </summary>
        public PointEmitter()
        {
            this.Random = new Random();
            this.Radius = 1.0f;
        }

        /// <summary>
        /// Get random position.
        /// </summary>
        /// <returns></returns>
        public Vector3 GetRandomPosition()
        {
            return new Vector3(
                ((float)this.Random.NextDouble() - 0.5f) * this.RadiusMultiplier,
                ((float)this.Random.NextDouble() - 0.5f) * this.RadiusMultiplier,
                ((float)this.Random.NextDouble() - 0.5f) * this.RadiusMultiplier);
        }

        /// <summary>
        /// Get random velocity.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public Vector3 GetRandomVelocity(Microsoft.Xna.Framework.Vector3 position)
        {
            return Vector3.Zero;
        }
    }
}
